
def func():
    str1 = '''拷贝过来的字符串'''
    list1 = []

    for each in str1:
        if each not in list1:
            if each == '\n':
                print('\\n', str1.count(each))
            else:
                print(each, str1.count(each))
            list1.append(each)


if __name__ == "__main__":
    func()